package com.sgj.springcloud.service.impl;

import com.sgj.springcloud.dao.PaymentDao;
import com.sgj.springcloud.entities.Payment;
import com.sgj.springcloud.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 沈国纪
 * @date 2021/5/4 11:57
 */
@Service
public class PaymentServiceImpl implements PaymentService {

	@Autowired
	private PaymentDao paymentDao;

	/**
	 * 新建订单
	 * @param payment
	 * @return
	 */
	@Override
	public int create(Payment payment) {
		return paymentDao.create(payment);
	}

	/**
	 * 根据 id 获取订单
	 * @param id
	 * @return
	 */
	@Override
	public Payment getPaymentById(Long id) {
		return paymentDao.getPaymentById(id);
	}
}
